package com.taotao.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.taotao.apitype.ApiHepler;
import com.taotao.apitype.ApiHepler.PagingResponse;
import com.taotao.common.pojo.EasyUIDataGridResult;
import com.taotao.domain.TbUser;
import com.taotao.service.impl.UserImpl;
import com.taotao.viewmodel.UserView;

@RestController
public class MainController {
	@Autowired
	private DiscoveryClient discoveryClient;
	@Autowired
	private UserImpl userImpl;

	@RequestMapping(path = "/userList", method = RequestMethod.GET)
	public ApiHepler.PagingResponse<TbUser> userList(Map<String, Object> data) throws Exception {
		PagingResponse<TbUser> userList = userImpl.userList(data);
		return userList;
	}

	public String SaveUser(@RequestBody UserView data) {
 
		return "";
	}

	@RequestMapping("/")
	public String sayhello() {
		return "欢迎进入用户系统！";
	}

}
